home *** CD-ROM | disk | FTP | other *** search
- /********************************************************************
-
- PROGRAM: DGVPLAYR.C
-
- PURPOSE: Video Player
-
- Amended by Bob Ashmore Compuserve id 100024,1753
-
-
- This code allows more than 1 instance of the video driver to display
- at a time. All data for the Driver Instance for the current window
- is held in the Instance windows property list. I have also allowed
- the user to load and play AVI files,the only problem I encountered
- with AVI was that you could not pause the avi driver after it was
- loaded.
- I also put in a dialog box to control the driver so as people can
- see how its done. I have put in an option to go 1 frame backward
- this can take quite some time to execute due to the fact that I
- go back to the previous reference frame and play forward to the
- current frame. I have encountered some problems with the freeze
- option when the window is misaligned ie it goes black. I tried to
- make the video windows a child of the main window but when you
- move the parent the video area is corrupted. I have also opened the
- driver before I open the window so I can obtain the size of the
- source bitmap and make the window the same size when I create it.
- The code is very rough and ready since this is my first encounter
- with windows programming and its a bit overwelming at first. I
- whould love to be able to change the menu to a set of owner draw
- buttons like a VCR but I dont yet no how any help is welcome. I hope
- this code is of some use to people. I have also allowed the user to
- suspend an instance of the driver as discribed in the documentation
- and it works.You can load about 3 stills at 1 time or 1 movie and
- 2 stills. if you want 2 movies you can load 1 movie and suspend it
- then load the second of course only 1 can be active at 1 time.Its
- quite impressive to see an avi movie and an avs movie playing in
- overlaping windows at the same time.
- ********************************************************************/
-
- #define NOCOMM
- #define WINVER 0x0300
-
- #include <windows.h>
- #include <stdlib.h>
- #include <direct.h>
- #include <string.h>
- #include <commdlg.h>
- #include <mmsystem.h>
- #include <digitalv.h>
- #include "dgvplayr.h"
-
- static HWND hMainWnd; // Main window handle
- static HWND hArrVideoWnd[10]; // Up to 10 driver windows
- static HWND hCurrentVideoWnd; // Current window handle
- static short vInstNum=1; // Unique number for Instance
- char szvPropEntry[] = "DVIDRV"; // Property entry name
- static char DVIFilename[_MAX_PATH]; // AVSS file name
- static char szAppName[] = "DgvPlayer"; // Aplication name
- HANDLE hInst; // Handle to current instance
- static char szFileName[128]; // Filename of AVSS file
- static char szDirName[256]; // Directory name
- static char szDriverName[256]; // Driver name
- static char szMainClass[] = "dgmclass"; // Class name for Main window
- static char szVideoClass[] = "dgvclass"; // Class name for video windows
- static char szMainMenu[] = "dvimain"; // Menu name for Main window
- static char szVideoMenu[] = "dviplay"; // Menu name for video windows
- static HCURSOR hcurWait = NULL; //- hourglass cursor
- static HCURSOR hcurSaved; //- old cursor
-
- // Local Function Prototypes
-
- LONG FAR PASCAL DVIWndProc(HWND, unsigned, WORD, LONG);
- LONG FAR PASCAL MainWndProc(HWND, unsigned, WORD, LONG);
- static BOOL InitApplication(HANDLE hInstance);
- static BOOL InitInstance(HANDLE hInstance, int nCmdShow);
- BOOL GetFileName (LPSTR szFileName);
- static void UpdateMenus(HWND);
- static void DisableMenus(HWND hwnd);
- static void DisplayError(HWND, DWORD);
- void OpenVideoWindow (LPSTR szTitle, HWND hOwner);
- int StoreChildHandle(HWND hwnd);
- int FreeChildHandle(HWND hwnd);
- int VidsOpen(void);
- BOOL FAR PASCAL AboutDlg(HWND hDlg, unsigned message,
- WORD wParam, LONG lParam);
- BOOL FAR PASCAL DriverDlg(HWND hDlg, unsigned message,
- WORD wParam, LONG lParam);
-
-
- /********************************************************************
-
- FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
-
- PURPOSE: Standard MS Windows main window funtion.
- ********************************************************************/
- int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow)
- {
-
- MSG msg;
- WORD wMessage;
-
- // Register classes if we are the first instance
-
- if(!hPrevInstance)
- if(!InitApplication(hInstance)) // Initialize shared things
- return(FALSE); // Exit if unable to initialize
-
- // Perform initializations that apply to a specific instance
-
- if(!InitInstance(hInstance, nCmdShow))
- return(FALSE);
-
- wMessage = RegisterWindowMessage((LPSTR)"MCIERR_HARDWARE");
- if(!wMessage)
- {
- MessageBox(GetFocus(),
- "Unable to register window message MCIERR_HARDWARE - terminating",
- szAppName,
- MB_ICONASTERISK | MB_OK);
- return FALSE;
- }
-
- // Acquire and dispatch messages until a WM_QUIT message is received
-
- while(GetMessage(&msg, NULL, 0, 0))
- {
- // trap the System Shutdown message here. If found, send
- // our main window proc a message telling it to close down.
- // Any other messages we process as normal.
-
- if(msg.message == wMessage)
- PostMessage(hMainWnd, WMU_SYSTEMSHUTDOWN, 0, 0L);
- else
- {
- TranslateMessage(&msg); // Translates virtual key codes
- DispatchMessage(&msg); // Dispatches message to window
- }
- }
-
- return(msg.wParam); // Return the value from PostQuitMessage
- }
-
- /********************************************************************
-
- FUNCTION: InitApplication(HANDLE)
-
- PURPOSE: Initializes window data and registers window class
- ********************************************************************/
- static BOOL InitApplication(HANDLE hInstance)
- {
-
- WNDCLASS wc;
-
- wc.style = NULL;
- wc.lpfnWndProc = (WNDPROC)MainWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = NULL;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(WHITE_BRUSH);
- wc.lpszMenuName = szMainMenu;
- wc.lpszClassName = szMainClass;
-
- if(!RegisterClass(&wc))
- return FALSE;
-
- wc.style = NULL;
- wc.lpfnWndProc = (WNDPROC)DVIWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon(hInstance, "playback");
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = GetStockObject(BLACK_BRUSH);
- wc.lpszMenuName = NULL; //szVideoMenu;
- wc.lpszClassName = szVideoClass;
-
- if(!RegisterClass(&wc))
- {
- UnregisterClass (szMainClass, hInstance);
- return FALSE;
- }
-
- hcurWait = LoadCursor(NULL, IDC_WAIT);
-
- return TRUE;
- }
-
- /********************************************************************
-
- FUNCTION: InitInstance(HANDLE, int)
-
- PURPOSE: Saves instance handle and creates main window
-
- ********************************************************************/
- static BOOL InitInstance(HANDLE hInstance, int nCmdShow)
- {
-
- HDC hDC;
- int cxScr,cyScr,i;
-
- for(i=0;i<10;i++)
- hArrVideoWnd[i] = NULL; // Setup the child window handles
-
- hDC = GetDC (NULL); // Get the DC for whole screen
- cxScr = GetDeviceCaps (hDC, HORZRES); // Get the Screen width
- cyScr = GetDeviceCaps (hDC, VERTRES); // Get the Screen length
- ReleaseDC (NULL, hDC); // Release Screen DC
- hInst = hInstance; // Save the instance handle
-
- hMainWnd = CreateWindow(szMainClass,
- szAppName, // Text for window title bar.
- WS_OVERLAPPEDWINDOW | // Window style.
- WS_CLIPCHILDREN,
- 0, // Default horizontal position.
- 0, // Default vertical position.
- cxScr, // Default width.
- cyScr, // Default height.
- NULL, // Overlapped windows have no parent.
- NULL, // Use the window class menu.
- hInstance, // This instance owns this window.
- NULL); // Pointer not needed.
-
- // Make the window visible and update its client area
-
- ShowWindow(hMainWnd, nCmdShow); // Show the window
- UpdateWindow(hMainWnd); // Sends WM_PAINT message
- return(TRUE);
- }
-
-
- /********************************************************************
-
- FUNCTION: MainWndProc(HWND, unsigned, WORD, LONG)
-
- PURPOSE: This is the callback function for the main window
-
- ********************************************************************/
- LONG FAR PASCAL MainWndProc(HWND hwnd, unsigned message,
- WORD wParam, LONG lParam)
- {
-
- char Rtn[256];
- DWORD Result;
- int i;
-
- switch(message)
- {
- case WMU_SYSTEMSHUTDOWN:
- // After an System Shutdown we must close the driver
- // to protect system integrity. We display a message at this
- // point telling users that they may open a new file.
-
- // Some shutdowns cause us to lose focus, so get it back.
-
- SetFocus(hwnd);
-
- // Tell the user we're shutting down.
-
- MessageBox(NULL,
- "A System Shutdown has occurred and all files are being closed. You may select a new file to be played or exit.",
- "Sample Player Demonstration",
- MB_ICONASTERISK | MB_OK);
-
- // Close down all driver instances.
-
- for(i=0;i<10;i++)
- if(hArrVideoWnd[i] != NULL)
- {
- SendMessage(hArrVideoWnd[i], WM_CLOSE, 0, 0L);
- hArrVideoWnd[i] = NULL;
- }
- hCurrentVideoWnd = NULL;
-
- // Close down all drivers.
-
- Result = mciSendString("close all", Rtn, sizeof(Rtn),(HANDLE)hwnd);
- if(Result)
- DisplayError(hwnd, Result);
-
- break;
-
- case WM_COMMAND:
- switch(wParam)
- {
- case DVM_MOD:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_MOD, 0L);
- break;
- case DVM_SUS:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_SUS, 0L);
- break;
- case DVM_EXIT:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_EXIT, 0L);
- break;
-
- case DVM_PLAY:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_PLAY, 0L);
- break;
- case DVM_PAUSE:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_PAUSE, 0L);
- break;
- case DVM_REWIND:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_REWIND, 0L);
- break;
- case DVM_STEP:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_STEP, 0L);
- break;
- case DVM_REVERSE:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_REVERSE, 0L);
- break;
-
- case IDM_OPEN:
- // The user wants to open a driver instance so go get an
- // AVSS file using the 3.1 common file dialog
- if(GetFileName (szFileName))
- OpenVideoWindow ((LPSTR)szFileName,NULL); //Open driver instance
- break;
-
- case IDM_EXIT:
- for(i=0;i<10;i++)
- if(hArrVideoWnd[i] != NULL)
- SendMessage(hArrVideoWnd[i], WM_CLOSE, 0, 0L);
- Result = mciSendString("close all", Rtn, sizeof(Rtn),(HANDLE)hwnd);
- if(Result)
- DisplayError(hwnd, Result);
- SendMessage (hwnd, WM_CLOSE, 0, 0L);
- break;
-
- case IDM_ABOUT:
- break;
-
- default:
- return(DefWindowProc(hwnd, message, wParam, lParam));
- }
- break;
- case WM_MOVE:
- case WM_SIZE:
- SetWindowPos(hCurrentVideoWnd,hMainWnd,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
- break;
- case WM_PAINT :
- SendMessage(hCurrentVideoWnd, WM_PAINT, 0, 0L);
- return(DefWindowProc(hwnd, message, wParam, lParam));
-
- case WM_CLOSE:
- DestroyWindow(hwnd);
- break;
-
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
-
- default:
- return(DefWindowProc(hwnd, message, wParam, lParam));
- }
-
- return(0);
- }
-
- /********************************************************************
-
- FUNCTION: OpenVideoWindow (LPSTR szTitle, HWND hOwner)
-
- PURPOSE: This creates a new video window and opens a new
- instance of the driver.
-
- ********************************************************************/
- void OpenVideoWindow (LPSTR szFile, HWND hOwner)
- {
- HWND hwnd;
- HDC hDC;
- int cxScr,cyScr;
- char Cmd[256];
- char Rtn[256];
- DWORD Result;
- RECT CurRect;
- RECT NewRect;
- HANDLE hMem;
- PSTR pMem;
- HMENU hMenu;
- long lFrameNo;
- int i,nArray[4];
- char *ptr,*ptr1;
- vidwin_t *vData;
- RECT rect;
-
-
- lstrcpy(DVIFilename,szFile);
-
- hcurSaved = SetCursor(hcurWait);
- hMem = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT,sizeof(vidwin_t));
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- vData->vInstNum = vInstNum++;
- wsprintf(vData->vIname, "%s%u",(LPSTR) "DVI",vData->vInstNum);
- wsprintf(Cmd, "open %s alias %s",(LPSTR) DVIFilename,(LPSTR)vData->vIname);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), NULL);
- if(Result)
- {
- DisplayError(hwnd, Result);
- SetCursor(hcurSaved);
- return;
- }
- wsprintf(Cmd, "where %s source",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), NULL);
- if(Result)
- {
- DisplayError(hwnd, Result);
- SetCursor(hcurSaved);
- return;
- }
- ptr = ptr1 = Rtn;
- i=0;
- while(*ptr)
- {
- if(*ptr == 32)
- {
- *ptr = 0;
- nArray[i++] = atoi(ptr1);
- ptr1 = ptr+1;
- }
- ptr++;
- }
- nArray[i] = atoi(ptr1);
- hwnd = CreateWindow(szVideoClass,
- szFile,
- WS_OVERLAPPEDWINDOW,
- 40+(VidsOpen() * 30),
- 64+(VidsOpen() * 24),
- nArray[2],
- nArray[3],
- hMainWnd,
- NULL,
- hInst,
- NULL);
-
- if(!hwnd)
- return;
-
- strcpy(vData->DVIFilename,DVIFilename);
- vData->State = PAUSING;
- vData->wVolume = 500;
- vData->lFrameNo = 1;
- vData->lStatusFrameNo = 1;
- vData->wAudon = TRUE;
- vData->wVidon = TRUE;
- vData->hWnd = hwnd;
- // Get the size of the source bitmap
-
- SetProp(hwnd,(LPSTR) szvPropEntry,hMem);
- wsprintf(Cmd, "window %s handle %u",(LPSTR)vData->vIname,hwnd);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- SetCursor(hcurSaved);
- return;
- }
- wsprintf(Cmd, "pause %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- // AVI files will not allow a pause at the start ???
- wsprintf(Cmd, "play %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- return;
- }
- vData->State = PLAYING;
- }
- LocalUnlock(hMem);
- DisableMenus(hwnd);
- SetCursor(LoadCursor(NULL, IDC_ARROW));
- StoreChildHandle(hwnd); //Save the child and make current
- SetCursor(hcurSaved);
-
- // Make the window visible and update its client area
-
- ShowWindow(hwnd, SW_SHOWNORMAL); // Show the window
- UpdateWindow (hwnd);
- UpdateMenus(hMainWnd);
-
- }
-
- /********************************************************************
-
- FUNCTION: DVIWndProc(HWND, unsigned, WORD, LONG)
-
- PURPOSE: This is the callback function for the Video window's
-
- ********************************************************************/
- LONG FAR PASCAL DVIWndProc(HWND hwnd, unsigned message,
- WORD wParam, LONG lParam)
- {
- FARPROC lpDlgProc;
- char Cmd[256];
- char Rtn[256];
- DWORD Result;
- RECT CurRect;
- RECT NewRect;
- HANDLE hMem;
- PSTR pMem;
- HMENU hMenu;
- long lFrameNo,lStatusFrameNo;
- int i,nArray[4];
- char *ptr,*ptr1;
- vidwin_t *vData;
- RECT rect;
-
- switch(message)
- {
- case MM_MCINOTIFY:
-
- // MCI Notify message, get after play, rewind, or step is done.
- // This window was specified in the callback of mciSendString.
- switch(wParam)
- {
- case MCI_NOTIFY_SUPERSEDED:
- break;
-
- case MCI_NOTIFY_SUCCESSFUL:
- case MCI_NOTIFY_ABORTED:
- case MCI_NOTIFY_FAILURE:
-
- // if we are closing a file due to a System Shutdown,
- // do nothing here.
-
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- if(vData->State == CLOSED || vData->State == SUSPENDED)
- {
- LocalUnlock(hMem);
- break;
- }
- // now in a paused state
-
-
-
- if(vData->State == PLAYING)
- vData->State = END; // we're at the end of the file
- else
- vData->State = PAUSED; // we've reached a known state
- LocalUnlock(hMem);
-
- UpdateMenus(hMainWnd);
- break;
- }
- break;
-
- case WM_COMMAND:
- switch(wParam)
- {
- case DVM_SUS:
- // Will now suspend this Instance of the driver
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- if(vData->State != SUSPENDED)
- {
- wsprintf(Cmd, "pause %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "status %s position",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->lFrameNo = atol(Rtn);
- wsprintf(Cmd, "status %s reference %ld",(LPSTR)vData->vIname,vData->lFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->lStatusFrameNo = atol(Rtn);
- wsprintf(Cmd, "status %s volume",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->wVolume = atoi(Rtn);
- wsprintf(Cmd, "status %s audio",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- if(!stricmp(Rtn,"on"))
- vData->wAudon = TRUE;
- else
- vData->wAudon = FALSE;
- wsprintf(Cmd, "status %s video",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- if(!stricmp(Rtn,"on"))
- vData->wVidon = TRUE;
- else
- vData->wVidon = FALSE;
- wsprintf(Cmd, "close %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = SUSPENDED;
- hMenu = GetMenu(hwnd);
- ModifyMenu(hMenu,DVM_SUS,MF_BYCOMMAND,DVM_SUS,(LPSTR)"Resume");
- LocalUnlock(hMem);
- DisableMenus(hwnd);
- break;
- }
- else
- {
- // Will now resume this Instance of the driver
- hcurSaved = SetCursor(hcurWait);
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
-
- if(vData->State != SUSPENDED)
- {
- MessageBox(GetFocus(),
- "This Driver is not Suspended",
- szAppName,
- MB_ICONASTERISK | MB_OK);
- LocalUnlock(hMem);
- break;
- }
-
- wsprintf(Cmd, "open %s alias %s",(LPSTR) vData->DVIFilename,(LPSTR)vData->vIname);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
-
- wsprintf(Cmd, "window %s handle %u",(LPSTR)vData->vIname,hwnd);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "setaudio %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "freeze %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
-
- wsprintf(Cmd, "seek %s to %ld",(LPSTR)vData->vIname,vData->lStatusFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "play %s to %ld wait",(LPSTR)vData->vIname,vData->lFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "unfreeze %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "setaudio %s volume to %d",(LPSTR)vData->vIname,vData->wVolume);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- if(vData->wAudon == TRUE)
- wsprintf(Cmd, "setaudio %s on",(LPSTR)vData->vIname);
- else
- wsprintf(Cmd, "setaudio %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- if(vData->wVidon == TRUE)
- wsprintf(Cmd, "setvideo %s on",(LPSTR)vData->vIname);
- else
- wsprintf(Cmd, "setvideo %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = PAUSING;
- wsprintf(Cmd, "pause %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- LocalUnlock(hMem);
- hMenu = GetMenu(hwnd);
- ModifyMenu(hMenu,DVM_SUS,MF_BYCOMMAND,DVM_SUS,(LPSTR)"Suspend");
- SetCursor(hcurSaved);
- break;
- }
- case DVM_MOD:
- lpDlgProc = MakeProcInstance(DriverDlg, hInst);
- DialogBox(hInst, "DriverMod", hwnd, lpDlgProc);
- FreeProcInstance(lpDlgProc);
- break;
-
- case DVM_DEFAULT:
-
- // Restore window to default size
-
- GetWindowRect(hwnd, &CurRect);
- SetRect(&NewRect, 0, 0, 319, 239);
- AdjustWindowRect(&NewRect, WS_OVERLAPPEDWINDOW, TRUE);
- MoveWindow(hwnd,
- CurRect.left,
- CurRect.top,
- NewRect.right - NewRect.left,
- NewRect.bottom - NewRect.top + 1,
- TRUE);
- break;
-
- case DVM_PAUSE:
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "pause %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = PAUSING;
- LocalUnlock(hMem);
- DisableMenus(hwnd);
- break;
-
- case DVM_PLAY:
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "play %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = PLAYING;
- LocalUnlock(hMem);
- UpdateMenus(hMainWnd);
- break;
-
- case DVM_REWIND:
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "seek %s to start notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = REWINDING;
- LocalUnlock(hMem);
- DisableMenus(hwnd);
- break;
-
- case DVM_STEP:
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "step %s notify",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- vData->State = STEPPING;
- LocalUnlock(hMem);
- DisableMenus(hwnd);
- break;
-
- case DVM_REVERSE:
- // This code allows you to go back 1 frame but because
- // of the nature of the compression system it is very
- // slow due to the workaround I have to use.
-
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- hcurSaved = SetCursor(hcurWait);
- wsprintf(Cmd, "pause %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "freeze %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "setaudio %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "status %s position",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- lFrameNo = (atol(Rtn)) - 1;
- wsprintf(Cmd, "status %s reference %ld",(LPSTR)vData->vIname,lFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- lStatusFrameNo = atol(Rtn);
- vData->State = STEPPING;
- wsprintf(Cmd, "seek %s to %ld",(LPSTR)vData->vIname,lStatusFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "play %s to %ld wait",(LPSTR)vData->vIname,lFrameNo);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- if(vData->wAudon == TRUE)
- wsprintf(Cmd, "setaudio %s on",(LPSTR)vData->vIname);
- else
- wsprintf(Cmd, "setaudio %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- wsprintf(Cmd, "unfreeze %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hwnd);
- if(Result)
- {
- DisplayError(hwnd, Result);
- LocalUnlock(hMem);
- break;
- }
- SetCursor(hcurSaved);
- LocalUnlock(hMem);
- break;
-
- case DVM_EXIT:
- SendMessage(hwnd, WM_CLOSE, 0, 0L);
- return(0);
-
- default:
- return(DefWindowProc(hwnd, message, wParam, lParam));
- }
- break;
-
- case WM_ACTIVATE:
- if(wParam && !HIWORD(lParam))
- hCurrentVideoWnd = hwnd;
- break;
-
- case WM_PAINT:
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "update %s hdc 0",(LPSTR)vData->vIname);
- LocalUnlock(hMem);
- mciSendString(Cmd, Rtn, sizeof(Rtn), hwnd);
- return(DefWindowProc(hwnd, message, wParam, lParam));
-
- case WM_CLOSE:
-
- // if a file is open, first close it
-
- hMem = GetProp(hwnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- if(vData->State != SUSPENDED)
- {
- wsprintf(Cmd, "close %s",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd, Rtn, sizeof(Rtn), hwnd);
- if(Result)
- DisplayError(hwnd, Result);
- }
- LocalUnlock(hMem);
- RemoveProp(hwnd,(LPSTR) szvPropEntry);
- LocalFree(hMem);
- FreeChildHandle(hwnd);
- DestroyWindow(hwnd);
- break;
-
- case WM_DESTROY:
- break;
-
- default:
- return(DefWindowProc(hwnd, message, wParam, lParam));
- }
-
- return(0);
- }
-
- /********************************************************************
-
- FUNCTION: UpdateMenus()
-
- ********************************************************************/
- static void UpdateMenus(HWND hwnd)
- {
-
- HANDLE hMem;
- PSTR pMem;
- vidwin_t *vData;
-
- hMem = GetProp(hCurrentVideoWnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
-
- switch(vData->State)
- {
- case REWINDING:
- case STEPPING:
- case PAUSING:
-
- // executing a command, don't allow anything
-
- EnableMenuItem(GetMenu(hwnd), DVM_OPEN, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PLAY, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PAUSE, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_STEP, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_REWIND, MF_GRAYED);
- break;
-
- case END:
- // at end of file, can only rewind
-
- EnableMenuItem(GetMenu(hwnd), DVM_OPEN, MF_ENABLED);
- EnableMenuItem(GetMenu(hwnd), DVM_PLAY, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PAUSE, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_STEP, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_REWIND, MF_ENABLED);
- break;
-
- case PLAYING:
- // playing a file, only allow pausing
-
- EnableMenuItem(GetMenu(hwnd), DVM_OPEN, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PLAY, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PAUSE, MF_ENABLED);
- EnableMenuItem(GetMenu(hwnd), DVM_STEP, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_REWIND, MF_GRAYED);
- break;
-
- case PAUSED:
- // Paused, allow open a new file, play, step, and rewind
-
- EnableMenuItem(GetMenu(hwnd), DVM_OPEN, MF_ENABLED);
- EnableMenuItem(GetMenu(hwnd), DVM_PLAY, MF_ENABLED);
- EnableMenuItem(GetMenu(hwnd), DVM_PAUSE, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_STEP, MF_ENABLED);
- EnableMenuItem(GetMenu(hwnd), DVM_REWIND, MF_ENABLED);
- break;
- }
- LocalUnlock(hMem);
- DrawMenuBar(hwnd);
- }
-
- /********************************************************************
-
- FUNCTION: DisableMenus()
-
- ********************************************************************/
- static void DisableMenus(HWND hwnd)
- {
- EnableMenuItem(GetMenu(hwnd), DVM_OPEN, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PLAY, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_PAUSE, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_STEP, MF_GRAYED);
- EnableMenuItem(GetMenu(hwnd), DVM_REWIND, MF_GRAYED);
- DrawMenuBar(hwnd);
- }
-
- /********************************************************************
-
- FUNCTION: DisplayError(HWND, DWORD)
-
- PURPOSE: Display Error messages
-
- ********************************************************************/
- static void DisplayError(HWND hwnd, DWORD Result)
- {
- char ErrMsg[256];
-
- mciGetErrorString(Result, ErrMsg, sizeof(ErrMsg));
- MessageBox(hwnd, ErrMsg, szAppName, MB_OK);
- }
-
- BOOL GetFileName (LPSTR szFileName)
- {
- OPENFILENAME of;
- DWORD flags;
- static char szTitle[30]; // Dialog Box title
- static char szFile[256]; // File name
- static char szFileTitle[256]; // Title
- static char szDrive[5]; // Drive
- static char szDir[256]; // Directory
- static char szFname[10]; // Filename
- static char szExt[4]; // Extension
- static char *szFilter[] = // Filter
- {
- "AVSS Video",
- "*.avs",
- "AVI Video",
- "*.avi",
- ""
- };
-
-
- // Gets the default system directory for file open/save
-
- _getcwd (szDirName, sizeof (szDirName));
-
- // Initialize the OPENFILENAME members
-
- szFile[0] = '\0';
-
- lstrcpy(szTitle,"Load a Video File");
- flags = OFN_HIDEREADONLY;
-
- of.lStructSize = sizeof (OPENFILENAME);
- of.hwndOwner = GetFocus ();
- of.hInstance = hInst;
- of.lpstrFilter = szFilter[0];
- of.lpstrCustomFilter = NULL;
- of.nMaxCustFilter = 0L;
- of.nFilterIndex = 1L;
- of.lpstrFile = szFile;
- of.nMaxFile = sizeof (szFile);
- of.lpstrFileTitle = szFileTitle;
- of.nMaxFileTitle = sizeof (szFileTitle);
- of.lpstrInitialDir = szDirName;
- of.lpstrTitle = szTitle;
- of.Flags = flags;
- of.nFileOffset = 0;
- of.nFileExtension = 0;
- of.lpstrDefExt = NULL;
- of.lpfnHook = NULL;
- of.lpTemplateName = NULL;
-
- // Call the GetOpenFilename function
-
- if (GetOpenFileName (&of))
- {
- lstrcpy (szFileName, of.lpstrFile);
- return TRUE;
- }
- else
- return FALSE;
- }
-
- /********************************************************************
-
- FUNCTION: StoreChildHandle(HWND hwnd)
-
- PURPOSE: Stores the newly created driver window handle in
- hArrVideoWnd[] at the next available slot and sets
- hCurrentVideoWnd to this window
- ********************************************************************/
- int StoreChildHandle(HWND hwnd)
-
- {
- int i;
-
- for(i=0;i<10;i++)
- if(hArrVideoWnd[i] == NULL)
- {
- hArrVideoWnd[i] = hwnd;
- break;
- }
- hCurrentVideoWnd = hwnd;
- return hwnd;
- }
- /********************************************************************
-
- FUNCTION: FreeChildHandle(HWND hwnd)
-
- PURPOSE: Removes the entry for this driver window from
- hArrVideoWnd[]
-
- ********************************************************************/
- int FreeChildHandle(HWND hwnd)
-
- {
- int i;
-
- for(i=0;i<10;i++)
- if(hArrVideoWnd[i] == hwnd)
- {
- hArrVideoWnd[i] = NULL;
- break;
- }
- hCurrentVideoWnd = NULL;
- for(i=0;i<10;i++)
- if(hArrVideoWnd[i] != NULL)
- {
- hCurrentVideoWnd = hArrVideoWnd[i];
- SetFocus(hCurrentVideoWnd);
- UpdateWindow(hCurrentVideoWnd); // Sends WM_PAINT message
- break;
- }
- return 1;
- }
- /********************************************************************
-
- FUNCTION: VidsOpen()
-
- PURPOSE: Return the number of video windows open
-
- ********************************************************************/
- int VidsOpen(void)
-
- {
- int i,count;
-
- for(count=i=0;i<10;i++)
- if(hArrVideoWnd[i] != NULL)
- count++;
- return count;
- }
- /********************************************************************
-
- FUNCTION: AboutDlg(HWND, unsigned, WORD, LONG)
-
- PURPOSE: Processes messages for "About" dialog box
-
- ********************************************************************/
- BOOL FAR PASCAL AboutDlg(HWND hDlg, unsigned message,
- WORD wParam, LONG lParam)
- {
- switch (message)
- {
- case WM_INITDIALOG :
- return (TRUE);
-
- case WM_COMMAND :
- if ((wParam == IDOK) ||
- (wParam == IDCANCEL))
- {
- EndDialog(hDlg, TRUE);
- return (TRUE);
- }
- break;
- }
-
- return (FALSE);
- }
-
- /********************************************************************
-
- FUNCTION: AboutDlg(HWND, unsigned, WORD, LONG)
-
- PURPOSE: Processes messages for "About" dialog box
-
- ********************************************************************/
- BOOL FAR PASCAL DriverDlg(HWND hDlg, unsigned message,
- WORD wParam, LONG lParam)
- {
-
- static HWND hScroll;
- static int uVolume;
- char Cmd[256];
- char Rtn[256];
- DWORD Result;
- HANDLE hMem;
- PSTR pMem;
- vidwin_t *vData;
-
- switch(message)
- {
- case WM_INITDIALOG:
- hMem = GetProp(hCurrentVideoWnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- wsprintf(Cmd, "info %s product",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- SetDlgItemText(hDlg,IDM_PRODUCT,Rtn);
- wsprintf(Cmd, "info %s version",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- SetDlgItemText(hDlg,IDM_VERSION,Rtn);
- SetDlgItemText(hDlg,IDM_DRVFILE,vData->DVIFilename);
- wsprintf(Cmd, "status %s length",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- SetDlgItemText(hDlg,IDM_NOFRAMES,Rtn);
- wsprintf(Cmd, "status %s audio",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- if(!stricmp(Rtn,"on"))
- CheckDlgButton(hDlg,IDM_AUDIO,TRUE);
- wsprintf(Cmd, "status %s video",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- if(!stricmp(Rtn,"on"))
- CheckDlgButton(hDlg,IDM_VIDEO,TRUE);
- hScroll = GetDlgItem(hDlg,IDM_VOLUME);
- SetScrollRange(hScroll,SB_CTL,0,1000,TRUE);
- wsprintf(Cmd, "status %s volume",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), hDlg);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- uVolume = atoi(Rtn);
- SetScrollPos(hScroll,SB_CTL,uVolume,TRUE);
- LocalUnlock(hMem);
- return (TRUE);
-
- case WM_HSCROLL:
- switch (wParam)
- {
- case SB_THUMBPOSITION:
- case SB_THUMBTRACK:
- SetScrollPos(hScroll,SB_CTL,LOWORD(lParam),TRUE);
- break;
- case SB_PAGEDOWN:
- SetScrollPos(hScroll,SB_CTL,uVolume+100,TRUE);
- break;
- case SB_PAGEUP:
- SetScrollPos(hScroll,SB_CTL,uVolume-100,TRUE);
- break;
- case SB_LINEDOWN:
- SetScrollPos(hScroll,SB_CTL,uVolume+1,TRUE);
- break;
- case SB_LINEUP:
- SetScrollPos(hScroll,SB_CTL,uVolume-1,TRUE);
- break;
- case SB_BOTTOM:
- SetScrollPos(hScroll,SB_CTL,0,TRUE);
- break;
- case SB_TOP:
- SetScrollPos(hScroll,SB_CTL,1000,TRUE);
- break;
- default:
- break;
- }
-
- hMem = GetProp(hCurrentVideoWnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- uVolume = GetScrollPos(hScroll,SB_CTL);
- wsprintf(Cmd, "setaudio %s volume to %d",(LPSTR)vData->vIname,uVolume);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), NULL);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- LocalUnlock(hMem);
- return 0;
- case WM_COMMAND :
- switch (wParam)
- {
- case IDOK:
- case IDCANCEL:
- case IDM_OK:
- EndDialog(hDlg, TRUE);
- return (TRUE);
- case IDM_VIDEO:
- hMem = GetProp(hCurrentVideoWnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- if(IsDlgButtonChecked(hDlg,IDM_VIDEO))
- wsprintf(Cmd, "setvideo %s on",(LPSTR)vData->vIname);
- else
- wsprintf(Cmd, "setvideo %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), NULL);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- LocalUnlock(hMem);
- break;
- case IDM_AUDIO:
- hMem = GetProp(hCurrentVideoWnd,(LPSTR) szvPropEntry);
- pMem = LocalLock(hMem);
- vData = (vidwin_t *)pMem;
- if(IsDlgButtonChecked(hDlg,IDM_AUDIO))
- wsprintf(Cmd, "setaudio %s on",(LPSTR)vData->vIname);
- else
- wsprintf(Cmd, "setaudio %s off",(LPSTR)vData->vIname);
- Result = mciSendString(Cmd,Rtn, sizeof(Rtn), NULL);
- if(Result)
- {
- DisplayError(hDlg, Result);
- LocalUnlock(hMem);
- break;
- }
- LocalUnlock(hMem);
- break;
-
- case IDM_PLAY:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_PLAY, 0L);
- break;
-
- case IDM_PAUSE:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_PAUSE, 0L);
- break;
-
- case IDM_REWIND:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_REWIND, 0L);
- break;
-
- case IDM_FRAME:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_STEP, 0L);
- break;
-
- case IDM_REVERSE:
- SendMessage(hCurrentVideoWnd, WM_COMMAND, DVM_REVERSE, 0L);
- break;
- }
- break;
- }
-
- return (FALSE);
- }
-